package cloud.estate.chargeDetail.controller;

import cloud.estate.chargeDetail.service.ChargeDetailService;
import cloud.estate.commons.bean.ChargeDetail;
import cloud.estate.commons.util.JsonResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/chargeDetail")
public class ChargeDetailController {
    @Resource
    private ChargeDetailService chargeDetailService;
    @PostMapping("/addOneChargeDetail")
    public JsonResult addOneChargeDetail(ChargeDetail chargeDetail) {
        return chargeDetailService.addOneChargeDetail(chargeDetail);
    }
    @PostMapping("/deleteOneChargeDetail")
    public JsonResult deleteOneChargeDetail(String id) {
        return chargeDetailService.deleteOneChargeDetail(id);
    }
    @PostMapping("/updateOneChargeDetail")
    public JsonResult updateOneChargeDetail(ChargeDetail chargeDetail) {
        return chargeDetailService.updateOneChargeDetail(chargeDetail);
    }
    @GetMapping("/findOneChargeDetail")
    public JsonResult findOneChargeDetail(String id) {
        return chargeDetailService.findOneChargeDetail(id);
    }
    @GetMapping("/findAllChargeDetail")
    public JsonResult findAllChargeDetail() {
        return chargeDetailService.findAllChargeDetail();
    }
}
